package paywithdrawlogic

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/dao/model/withdraw"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/rpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserAuthUpdateLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserAuthUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthUpdateLogic {
	return &UserAuthUpdateLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *UserAuthUpdateLogic) UserAuthUpdate(in *rpc.UserAuthUpdateReq) (ret *rpc.UserAuthUpdateRes, err error) {
	ret = &rpc.UserAuthUpdateRes{}
	m := withdraw.NewUserAuthModel(l.ctx, l.svcCtx.Db)
	ret.Data, err = m.UserAuthModelUpdate(in.GetData())
	if err != nil {
		return nil, err
	}
	return ret, nil
}
